<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8">
<title>开奖情况</title>
<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.1.0/css/bootstrap.min.css">
<script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
<script src="https://cdn.staticfile.org/popper.js/1.12.5/umd/popper.min.js"></script>
<script src="https://cdn.staticfile.org/twitter-bootstrap/4.1.0/js/bootstrap.min.js"></script>
<script src="https://cdn.staticfile.org/vue/2.4.2/vue.min.js"></script>
<script src="https://cdn.staticfile.org/vue-resource/1.5.1/vue-resource.min.js"></script>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.14.2/bootstrap-table.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.14.2/bootstrap-table.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.14.2/locale/bootstrap-table-zh-CN.min.js"></script>
<script src="https://cdn.bootcss.com/dayjs/1.7.8/dayjs.min.js"></script>
<link href="/css/common/common.css" rel="stylesheet" type="text/css">
<style type="text/css">
.lottery-situation-table .lottery-situation-issue-num {
	color: #2765a1;
	cursor: pointer;
}
</style>
</head>

<body>
	<div th:replace="common/header::html"></div>
	<div id="issue-manage" v-cloak>
		<form class="form-inline common-query-cond-form" action="#">
			<div class="form-group common-query-cond">
				<label>游戏:</label> <select class="form-control-sm" v-model="gameCode">
					<option value="">全部游戏</option>
					<option v-for="dictItem in gameDictItems" :value="dictItem.dictItemCode">{{dictItem.dictItemName}}</option>
				</select>
			</div>
			<div class="form-group common-query-cond">
				<label>期数:</label><input type="text" class="form-control-sm" v-model="issueNum">
			</div>
			<div class="form-group common-query-cond">
				<label>状态:</label> <select class="form-control-sm" v-model="state">
					<option value="">全部状态</option>
					<option v-for="dictItem in issueStateDictItems" :value="dictItem.dictItemCode">{{dictItem.dictItemName}}</option>
				</select>
			</div>
			<div class="form-group common-query-cond">
				<label>开奖日期:</label><input type="date" class="form-control-sm" v-model="lotteryStartDate"><span>到</span><input type="date" class="form-control-sm" v-model="lotteryEndDate">
			</div>
			<button type="button" class="btn btn-danger btn-sm" v-on:click="refreshTable">搜索</button>
		</form>
		<table class="common-table lottery-situation-table"></table>

		<div v-if="issueEditFlag">
			<div class="modal-mask">
				<div class="modal-wrapper">
					<div class="modal-dialog edit-issue-dialog">
						<div class="modal-content">
							<div class="modal-header">
								<h5 class="modal-title">期号编辑</h5>
								<button type="button" class="close" data-dismiss="modal" aria-label="Close" v-on:click="issueEditFlag = false">
									<span aria-hidden="true">&times;</span>
								</button>
							</div>
							<div class="modal-body">
								<form>
									<div class="form-group row">
										<div class="col-sm-12">
											<label>游戏:</label> <input type="text" class="form-control" v-model="selectedIssue.gameName" disabled>
										</div>
									</div>
									<div class="form-group row">
										<div class="col-sm-12">
											<label>期数:</label> <input type="text" class="form-control" v-model="selectedIssue.issueNum" disabled>
										</div>
									</div>
									<div class="form-group row">
										<div class="col-sm-12">
											<div class="custom-control custom-checkbox mb-3 custom-control-inline">
												<input type="checkbox" class="custom-control-input" id="automaticLottery" v-model="selectedIssue.automaticLottery"> <label class="custom-control-label" for="automaticLottery">自动开奖</label>
											</div>
											<div class="custom-control custom-checkbox mb-3 custom-control-inline">
												<input type="checkbox" class="custom-control-input" id="automaticSettlement" v-model="selectedIssue.automaticSettlement"> <label class="custom-control-label" for="automaticSettlement">自动结算</label>
											</div>
											<div class="custom-control custom-checkbox mb-3 custom-control-inline">
												<input type="checkbox" class="custom-control-input" id="issueInvalid" v-model="issueInvalid"> <label class="custom-control-label" for="issueInvalid">已作废</label>
											</div>
										</div>
									</div>
								</form>
							</div>
							<div class="modal-footer">
								<button type="button" class="btn btn-success btn-sm" v-on:click="updateIssue">保存</button>
								<button type="button" class="btn btn-sm" v-on:click="issueEditFlag = false">取消</button>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>

		<div v-if="manualLotteryFlag">
			<div class="modal-mask">
				<div class="modal-wrapper">
					<div class="modal-dialog manual-lottery-dialog">
						<div class="modal-content">
							<div class="modal-header">
								<h5 class="modal-title">手动开奖</h5>
								<button type="button" class="close" data-dismiss="modal" aria-label="Close" v-on:click="manualLotteryFlag = false">
									<span aria-hidden="true">&times;</span>
								</button>
							</div>
							<div class="modal-body">
								<form>
									<div class="form-group row">
										<div class="col-sm-12">
											<label>游戏:</label> <input type="text" class="form-control" v-model="selectedIssue.gameName" disabled>
										</div>
									</div>
									<div class="form-group row">
										<div class="col-sm-12">
											<label>期数:</label> <input type="text" class="form-control" v-model="selectedIssue.issueNum" disabled>
										</div>
									</div>
									<div class="form-group row">
										<div class="col-sm-12">
											<label>开奖号码:</label> <input type="text" class="form-control" v-model="selectedIssue.lotteryNum">
										</div>
									</div>
									<div class="form-group row">
										<div class="col-sm-12">
											<div class="custom-control custom-checkbox mb-3 custom-control-inline">
												<input type="checkbox" class="custom-control-input" id="autoSettlementFlag" v-model="autoSettlementFlag"> <label class="custom-control-label" for="autoSettlementFlag">开奖并结算</label>
											</div>
										</div>
									</div>
								</form>
							</div>
							<div class="modal-footer">
								<button type="button" class="btn btn-success btn-sm" v-on:click="manualLottery">确定</button>
								<button type="button" class="btn btn-sm" v-on:click="manualLotteryFlag = false">取消</button>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<script src="/js/lottery-situation.js"></script>
</body>
</html>